const app = getApp()
Page({
	data: {
		indexData:[],
		title:'工作日志',
		baseUrl: app.globalData.baseUrl,
	},
	onLoad(options) {
		var stt
		if(options.title=='项目计划'){
			stt='myplanView'
			this.setData({
				title:'项目计划'
			})
		}else{
			stt='mythelogView'
		}
		app.indexApi[stt](options.id).then(a => {
			if (a.code == 0) {
				wx.getStorageSync('ryList').forEach(item => {
					if(a.data.createBy==item.id){
						a.data.createBy=item.nickname
						a.data.head=item.avatar
					}
				});
				this.setData({
					indexData:a.data
				})
				console.log(this.data.indexData)
			}
		})
	},
	back(){
		wx.navigateBack({
			delta: -2,
			fail:function(){
			  wx.navigateTo({
				url: "/pages/index/index"
			  })
			}
		})
	}
})